﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Chapter03
{
    public class Code03
    {
        public static void Begin()
        {
            {
                sbyte sbyteVal = -128;
                byte byteVal = 128;
                short shortVal = -32768;
                ushort ushortVal = 65535;
                int intVal = -2147483648;
                uint uintVal = 4294967295;
                long longVal = -9223372036854775808L;
                ulong ulongVal = 18446744073709551615UL;
                float flatVal = -0.12345679F;
                double doubleVal = -0.123456789123456789D;
                decimal decimalVal = -0.666999M;
                char charVal = 'a';
                bool boolVal = false;
                string stringVal = "abcdefg";
                string join = string.Join("\n", sbyteVal, byteVal, shortVal, ushortVal, intVal, uintVal, longVal, ulongVal, flatVal, doubleVal, decimalVal, charVal, boolVal, stringVal);
                Console.WriteLine(join);
            }
            {
                string myString = "This string has a\nline break.";
                Console.WriteLine(myString);
            }
            {
                string myString1 = "Karli\'s string.";
                string myString2 = "Karli\u0027s string.";
                Console.WriteLine(string.Join("\n", myString1, myString2));
            }
            {
                string myString1 = @"Verbatim string literal.";
                string myString2 = @"A short list: \nitem1\nitem2";
                Console.WriteLine(string.Join("\n", myString1, myString2));
            }
            {
                string myString1 = "C:\\Temp\\MyDir\\MyFile.doc";
                string myString2 = @"C:\Temp\MyDir\MyFile.doc";
                Console.WriteLine(string.Join("\n", myString1, myString2));
            }
            {
                int age;
                age = 25;
                Console.WriteLine(age);
            }
            {
                int xSize, ySize;
                xSize = 0;
                ySize = 0;
                Console.WriteLine(string.Join("\n", xSize, ySize));
            }
            {
                int age = 25;
                int xSize = 4, ySize = 5;
                Console.WriteLine(string.Join("\n", age, xSize, ySize));
            }
            {
                int xSize, ySize = 5;
                xSize = 5;
                Console.WriteLine(string.Join("\n", xSize, ySize));
            }
            Console.ReadLine();
        }

        public static void BeginEx01()
        {
            int myInterger;
            string myString;
            myInterger = 17;
            myString = "\"myInger\" is";
            Console.WriteLine("{0} {1}.", myString, myInterger);
            Console.ReadLine();
        }
    }
}
